<!DOCTYPE html>
<html 
<head >
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css"  media="all"/>
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"/>
<link rel="stylesheet"  href="../../../css/common/loader.css" media="all"/>
<link rel="stylesheet"  href="../../../css/common/tablepage.css" media="all"/>
</head>
<body>
	<div class="layui-fluid">
		<div class="layui-card">
			<div class="layui-form layui-card-header layuiadmin-card-header-auto" id="searchForm">
			   <div class="layui-form-item">

                 <div class="layui-inline">
				  <label class="layui-form-label">店舗名</label>
				  <div class="layui-input-block">
				  <input type="text" name="shopName" placeholder="请输入" autocomplete="off" class="layui-input">
				   </div>
				 </div>

                 
				 <div class="layui-inline">
				  <button class="layui-btn layuiadmin-btn-sm" lay-submit
							lay-filter="searchSubmit"  >検索</button>
				</div>
				</div>
			</div>
			<div class="layui-card-body">
				<table id="dataList" lay-filter="dataList" ></table>
				
	
			</div>
		</div>
	</div>
<div type="text/html" id="trTool" style="display:none">
    <a  data-grant="system:printer:grant" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="grantShop"><i class="layui-icon layui-icon-edit"></i>分配</a>
    
</div>


<script   src="../../../layuiadmin/layui/layui.js"></script>
<script type="text/javascript" src="../../../lib/jQuery-2.2.0.min.js" ></script>
	<script>
		layui.config({
			base :  '../../../layuiadmin/' //静态资源所在路径
		}).extend({
			webplus : 'lib/webplus'//主入口模块
			
		}).use([ 'table','form','webplus' ], function() {
			var $ = layui.$,
			webplus=layui.webplus,
			form = layui.form,
			table = layui.table;
			var id=webplus.getUrlType().id
		   var cols= [ [ {
				type : 'numbers',
				title : '番号'
			}, {
				field : 'shopId',
				title : '编号',
				hide : true 
			},
            {
			 field : 'shopName',
			 title : '店铺名',
			 minWidth:250
			},  
            
          
           
            {

				title : '編集',
				toolbar : '#trTool',
				fixed: 'right',
				width :100
			} ] ];
		   webplus.init('buss/shop/list',cols,'','','','-1')
			 //监听行工具事件
			  table.on('tool(dataList)', function(rowObj){
			    switch(rowObj.event){
			    	
			    	case 'grantShop':
	                      
			    		var params={};
			    		params.printId=id;
			    		params.shopId=rowObj.data.shopId
			    		webplus.doAjax("buss/printer/grantShop",params,"你确定把该打印机分配给该店铺吗？","","1");
			   			break;
			    	
			    }
			  });
			 

		});
	</script>

</body>
</html>